package com.bdqn.mapper.impl;

import com.bdqn.mapper.StorageMapper;
import com.bdqn.pojo.Storage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Transactional
@Service("storageMapper")
public class StorageServiceImpl implements StorageMapper {
    @Autowired
    private StorageMapper storageMapper;

    /**
     * 入库信息添加
     *
     * @param storage
     * @return
     */
    @Override
    public int addStorage(Storage storage) {
        try {
            return storageMapper.addStorage(storage);
        } catch (RuntimeException e) {
            e.printStackTrace();
            throw e;
        }
    }

    @Override
    public int delid(Integer id) {
        try {
            return storageMapper.delid(id);
        } catch (RuntimeException e) {
            e.printStackTrace();
            throw e;
        }
    }

    @Override
    public int modify(Storage storage) {
        try {
            return storageMapper.modify(storage);
        } catch (RuntimeException e) {
            e.printStackTrace();
            throw e;
        }
    }
}
